// part1:C12:12.32:my_QueryResult.h
#ifndef QUERYRESULT_H__
#define QUERYRESULT_H__
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <set>
#include "my_StrBlob.h"
class QueryResult
{
  friend std::ostream& print(std::ostream&, const QueryResult&);
public:
  typedef std::vector<std::string>::size_type line_no;
  typedef std::set<line_no>::const_iterator line_it;
  QueryResult(std::string s,
      std::shared_ptr<std::set<line_no>> p,
      StrBlob f): 
    sought(s), lines(p), file(f) {}
  std::set<line_no>::size_type size() const 
  {
    return lines->size();
  }

  line_it begin() const { return lines->cbegin(); }
  line_it end() const { return lines->cend(); }
  StrBlob get_file() { return file; }
private:
  std::string sought;
  std::shared_ptr<std::set<line_no>> lines;
  StrBlob file;
};

std::ostream &print(std::ostream&, const QueryResult&);
#endif
